package com.usian.job;

import com.usian.pojo.User;
import com.usian.service.UserService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class Myjob  implements Job {

    @Autowired
    private UserService userService;

    private static  final Logger log = LoggerFactory.getLogger(Myjob.class);


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("quartz 执行内容");
        List<User> list = userService.findAll();
        log.info("quartz 执行内容"+list);
    }
}
